package com.qinggeng.project.api.dto;

import com.qinggeng.common.utils.StringUtils;
import com.qinggeng.common.utils.text.Convert;
import lombok.Data;

//订单大厅地址
@Data
public class OrdersDistAddressDto {

    //地址
    private String addressInfo;

    //精度
    private Float lng;

    //纬度
    private Float lat;

    //距离
    private Double distance;

    private String distanceName;

    private String consignee;

    private String phoneNumber;

    private String addressPhone;

    public String getAddressInfo() {
        return addressInfo;
    }

    public void setAddressInfo(String addressInfo) {
        this.addressInfo = addressInfo;
    }

    public Float getLng() {
        return lng;
    }

    public void setLng(Float lng) {
        this.lng = lng;
    }

    public Float getLat() {
        return lat;
    }

    public void setLat(Float lat) {
        this.lat = lat;
    }

    public Double getDistance() {
        return distance;
    }

    public void setDistance(Double distance) {
        this.distance=distance;
    }

    public String getDistanceName() {
        return Convert.distanceChange(distance);
    }

    public void setDistanceName(String distanceName) {
        this.distanceName = distanceName;
    }

    public String getConsignee() {
        return consignee;
    }

    public void setConsignee(String consignee) {
        this.consignee = consignee;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getAddressPhone() {
        //设置隐私号码
        if(StringUtils.isNotEmpty(phoneNumber)&&phoneNumber.length()==11){
            return phoneNumber.substring(0,3) + "****"+phoneNumber.substring(7,11);
        }
        return addressPhone;
    }

    public void setAddressPhone(String addressPhone) {
        this.addressPhone = addressPhone;
    }
}
